<template>
<div>
    <el-button type="primary" @click="setDialogVisible">打开对话框</el-button>
    <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="sex" label="性别" width="180">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="180">
        </el-table-column>
        <el-table-column prop="age" label="年龄">
        </el-table-column>
    </el-table>
    <CheckDialog ref="dialog" @submit="handleAdd"></CheckDialog>
</div>
   

</template>
<script>
import CheckDialog from './checkdialog.vue';
export default {
    components: {
        CheckDialog
    },

    data() {
        return {
            tableData: [{
                sex: '男',
                name: '歌谣',
                age: 18
            }, {
                sex: '男',
                name: '芳芳',
                age: 18
            }, {
                sex: '女',
                name: '芳芳',
                age: 18
            }]
        }
    },
    methods: {
        setDialogVisible() {
            this.$refs.dialog.setDialogVisible()
        },
        handleAdd(data) {
            this.tableData.push(data)
        }
    }
}
</script>